home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1315_non-rectangular_window_views.rtf < prev    next >
Text File  |  1995-06-12  |  2KB  |  42 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Courier;}
  2. \paperw13040
  3. \paperh10200
  4. \margl120
  5. \margr120
  6. {\colortbl;\red0\green0\blue0;\red84\green84\blue84;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q:  How can I make a non-rectangular Window?\
  8. Q:  How can I make a non-rectangular View?\
  9. \
  10. A:  You cannot at present make a non-rectangular Window.  We hear the request.  Tell us how important is this ability compared with your other needs.   The WhatADrag example on the 2.0 release (/NextDeveloper/Examples/WhatADrag) shows you how to create windows with transparency for dragging arbitrary shapes on the screen between windows.  This does not produce true transparent windows, but it accomplishes most of what developers need transparent windows for.\
  11. \
  12. A: You can clip a View to a non-rectangular shape by creating a subclass of View, and overriding the following View method to establish your own clipping path.\
  13. \
  14.  
  15. \f1\fs24 - clipToFrame:(const NXRect *) frameRect\
  16.  /*\
  17.   * TYPE: Focusing and displaying; Clips to frame during focusing \
  18.   *\
  19.   * This method is provided to allow for your View to do arbitrary clipping\
  20.   * during focusing.  This method is called from within the focusing\
  21.   * machinery if clipping is required.  The default implementation just\
  22.   * calls PSrectclip with the values in frameRect. You must use frameRect\
  23.   * rather than just looking at your View's frame instance variable,\
  24.   * because due to focusing, the origins may not be the same. \
  25.   */\
  26. \{\
  27.     PSrectclip(NX_X(frameRect), NX_Y(frameRect),\
  28.            NX_WIDTH(frameRect), NX_HEIGHT(frameRect));\
  29.     return self;\
  30. \}\
  31. \
  32. \
  33.  
  34. \f0\fs28\fc1\cf1 In addition, the 3.0 documentation on clipToFrame: contains an example of clipping the View to a circular region.\
  35.  
  36. \fc0\cf0 \
  37. QA33\
  38. \
  39. Valid for 1.0, 2.0, 3.0\
  40. \
  41.  
  42.